<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Curl转Excel</title>
    <link rel="icon" href="{{ url_for('static', filename='ico/favicon_curl.png') }}">

    <!-- highlight.js 的样式 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
    <!-- 重设 highlight.js 的样式 -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/excel_code.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/curl_to_excel_data.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/alert_msg.css') }}">

    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script>
    <script type="module" src="{{ url_for('static', filename='js/curl_to_pytest_excel.js') }}"></script>
    <script type="module" src="{{ url_for('static', filename='js/common.js') }}"></script>
    <script type="module" src="{{ url_for('static', filename='js/curl_to_excel.js') }}"></script>
</head>
<body>
<h2>可复制列表</h2>
<table id="dataTable">
    <thead>
    <tr>
        <th>用例编号</th>
        <th>接口名称</th>
        <th>模块</th>
        <th>优先级</th>
        <th>标题</th>
        <th>域名</th>
        <th>URL</th>
        <th>前置条件</th>
        <th>请求方式</th>
        <th>请求头</th>
        <th>请求参数</th>
        <th>预期结果</th>
        <th>响应预期结果</th>
        <th>实际结果</th>
    </tr>
    <tr>
        <th>case_id</th>
        <th>name</th>
        <th>model</th>
        <th>rank</th>
        <th>title</th>
        <th>host</th>
        <th>url</th>
        <th>precondition</th>
        <th>method</th>
        <th>header</th>
        <th>data</th>
        <th>expected</th>
        <th>expected_response</th>
        <th>actual</th>
    </tr>
    </thead>
    <tbody id="tableData">
    <tr>
        <td contenteditable="true">{{ case_id }}</td>
        <td contenteditable="true">{{ api_name }}</td>
        <td contenteditable="true">{{ model }}</td>

        <td contenteditable="true">P1</td>
        <td contenteditable="true">{{ title }}</td>
        <td contenteditable="true">{{ host }}</td>
        <td contenteditable="true">{{ url }}</td>
        <td contenteditable="true"></td>
        <td contenteditable="true">{{ method }}</td>
        <td contenteditable="true"></td>
        <!-- <td id="jsonData">{{ data|safe }}</td>-->
        <td contenteditable="true" id="jsonData">
            <pre id="jsonCodeCell"><code>{{ data|safe }}</code></pre>
        </td>
        <td contenteditable="true">OK</td>

        <!-- 下一行不要换行, 换行会导致显示时上下存在空行 -->
        <td contenteditable="true" id="jsonExpectedData"><pre><code id="jsonCodeBlock"></code></pre></td>

        <td contenteditable="true"></td>
    </tr>
    </tbody>
</table>
<div class="button-container">
    <button onclick="copyTable()">复制数据行</button>
    <a href="/" style="text-decoration: none;">
        <button>返回</button>
    </a>
</div>
<div id="custom-alert" class="custom-alert"></div>
</body>
</html>
